#ifndef __APP_XML_H__
#define __APP_XML_H__

typedef struct _XML_NODE_s_ XML_NODE_s;

extern ULONG xml_loadString(IN CHAR *pcString, INOUT XML_NODE_s **ppstNodeRoot);
extern ULONG xml_loadFile(IN CHAR *pcFilePath, INOUT XML_NODE_s **ppstNodeRoot);
extern ULONG xml_saveFile(IN XML_NODE_s *pstNodeRoot, IN CHAR *pcFilePath);
extern ULONG xml_destory(INOUT XML_NODE_s **ppstNodeRoot);
extern ULONG xml_getNodeByPath(IN XML_NODE_s *pstNodeRoot, IN CHAR *pcPath, OUT XML_NODE_s **ppstNode);
extern ULONG xml_getChildByName(IN XML_NODE_s *pstParentNode, IN CHAR *pcName, OUT XML_NODE_s **ppstNode);
extern ULONG xml_getFirstChildByName(XML_NODE_s *pstParentNode, IN CHAR *szName, OUT XML_NODE_s **ppstNode);
extern ULONG xml_getNextSiblingByName(XML_NODE_s *pstNode, IN CHAR *szName, OUT XML_NODE_s **ppstNode);
extern ULONG xml_getNodeAttrStr(IN XML_NODE_s *pstNode, IN CHAR *pcAttrName, IN UINT32 uLen, INOUT CHAR *pcText);
extern ULONG xml_getNodeAttrInt(XML_NODE_s *pstNode, IN CHAR *szAttrName, OUT INT32 *ps32Value);
extern ULONG xml_getNodeAttrU32(XML_NODE_s *pstNode, IN CHAR *szAttrName, OUT UINT32 *pu32Value);
extern ULONG xml_getNodeAttrDouble(XML_NODE_s *pstNode, IN CHAR *szAttrName, OUT DOUBLE *pdfValue);
extern ULONG xml_setNodeAttrStr(IN XML_NODE_s *pstNode, IN CHAR *szAttrName, IN CHAR *attr);
extern ULONG xml_setNodeAttrInt(IN XML_NODE_s *ptNode, IN CHAR *szAttrName, IN INT32 s32Value);
extern ULONG xml_setNodeAttrU32(IN XML_NODE_s *ptNode, IN CHAR *szAttrName, IN UINT32 u32Value);
extern ULONG xml_setNodeAttrDouble(IN XML_NODE_s *ptNode, IN CHAR *szAttrName, IN DOUBLE dfValue);
extern ULONG xml_getNodeValueCData(IN XML_NODE_s *ptNode,  IN UINT32 uIndex, IN UINT32 uLen, INOUT CHAR *pcText);
extern ULONG xml_getNodeValueStr(IN XML_NODE_s * pstNode, IN UINT32 uLen, OUT CHAR *pcTxt);
extern ULONG xml_getNodeValueInt(IN XML_NODE_s *pstNode, OUT INT32* ps32Value);
extern ULONG xml_getNodeValueU32(IN XML_NODE_s *pstNode, OUT UINT32* pu32Value);
extern ULONG xml_getNodeValueDouble(IN XML_NODE_s *pstNode, OUT DOUBLE* pdfValue);
extern ULONG xml_setNodeValueStr(IN XML_NODE_s * pstNode, IN CHAR *pcTxt);
extern ULONG xml_setNodeValueInt(IN XML_NODE_s *pstNode, IN INT32 s32Value);
extern ULONG xml_setNodeValueU32(IN XML_NODE_s *pstNode, IN UINT32 u32Value);
extern ULONG xml_setNodeValueDouble(IN XML_NODE_s *pstNode, IN DOUBLE df32Value);
extern ULONG xml_setNodeValueCData(IN XML_NODE_s *pstNode, IN UINT32 index, IN CHAR *pcTxt);
extern ULONG xml_getSonNodeValueStr(IN XML_NODE_s *pstParent, IN CHAR *szNodeName, IN UINT32 uLen, INOUT CHAR *pcText);
extern ULONG xml_getSonNodeValueInt(IN XML_NODE_s *pstParent, IN CHAR *szNodeName, INOUT INT32 *ps32Value);
extern ULONG xml_getSonNodeValueU32(IN XML_NODE_s *pstParent, IN CHAR *szNodeName, INOUT UINT32 *pu32Value);
extern ULONG xml_getSonNodeValueDouble(IN XML_NODE_s *pstParent, IN CHAR *szNodeName, INOUT DOUBLE *pdfValue);
extern ULONG xml_getSonNodeValueCData(IN XML_NODE_s *pstParent, IN CHAR *szNodeName, IN UINT32 uLen, INOUT CHAR *pcText);
extern ULONG xml_addNodeStr(IN XML_NODE_s *ptRootNode, IN CHAR *pcPath, IN CHAR *pcNodeName, IN CHAR *szValue);
extern ULONG xml_addNodeInt(IN XML_NODE_s *ptRootNode, IN CHAR *pcPath, IN CHAR *pcNodeName, IN INT32 s32Value);
extern ULONG xml_addNodeU32(IN XML_NODE_s *ptRootNode, IN CHAR *pcPath, IN CHAR *pcNodeName, IN UINT32 u32Value);
extern ULONG xml_addNodeDouble(IN XML_NODE_s *ptRootNode, IN CHAR *pcPath, IN CHAR *pcNodeName, IN DOUBLE dfValue);
extern ULONG xml_addNodeCDATA(IN XML_NODE_s *ptRootNode, IN CHAR *pcPath, IN CHAR *pcNodeName, IN CHAR *szData);

#endif
